Skip to content

[Scalarizer] Test *_with_overflow intrinsics with min-bits #127520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Feb 17, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 17, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Jay Foad (jayfoad)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/127520.diff

1 Files Affected:

  • (modified) llvm/test/Transforms/Scalarizer/min-bits.ll (+11)
diff --git a/llvm/test/Transforms/Scalarizer/min-bits.ll b/llvm/test/Transforms/Scalarizer/min-bits.ll
index 97cc71626e208..377893ad7e6fd 100644
--- a/llvm/test/Transforms/Scalarizer/min-bits.ll
+++ b/llvm/test/Transforms/Scalarizer/min-bits.ll
@@ -1081,6 +1081,17 @@ define <4 x half> @call_v4f16(<4 x half> %a, <4 x half> %b) {
   ret <4 x half> %r
 }
 
+define <3 x i32> @call_v3i32(<3 x i32> %a, <3 x i32> %b) {
+; CHECK-LABEL: @call_v3i32(
+; CHECK-NEXT:    [[T:%.*]] = call { <3 x i32>, <3 x i1> } @llvm.uadd.with.overflow.v3i32(<3 x i32> [[A:%.*]], <3 x i32> [[B:%.*]])
+; CHECK-NEXT:    [[R:%.*]] = extractvalue { <3 x i32>, <3 x i1> } [[T]], 0
+; CHECK-NEXT:    ret <3 x i32> [[R]]
+;
+  %t = call { <3 x i32>, <3 x i1> } @llvm.uadd.with.overflow.v3i32(<3 x i32> %a, <3 x i32> %b)
+  %r = extractvalue { <3 x i32>, <3 x i1> } %t, 0
+  ret <3 x i32> %r
+}
+
 declare <2 x half> @llvm.minnum.v2f16(<2 x half>, <2 x half>)
 declare <3 x half> @llvm.minnum.v3f16(<3 x half>, <3 x half>)
 declare <4 x half> @llvm.minnum.v4f16(<4 x half>, <4 x half>)

@jayfoad
Copy link
Contributor Author

jayfoad commented Feb 17, 2025

Hi @inbelic, this new test shows a breakage introduced by #126815. After your patch this test hits an assertion failure:

opt: include/llvm/Support/Casting.h:578: decltype(auto) llvm::cast(From *) [To = llvm::VectorType, From = llvm::Type]: Assertion `isa<To>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: opt -passes=function(scalarizer<load-store;min-bits=16>,dce) -S
1.	Running pass "function(scalarizer,dce)" on module "<stdin>"
2.	Running pass "scalarizer" on function "call_v3i32"
 #0 0x0000000004028908 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (opt+0x4028908)
 #1 0x000000000402643e llvm::sys::RunSignalHandlers() (opt+0x402643e)
 #2 0x0000000004029131 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x000075c457a45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x000075c457a9eb2c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x000075c457a9eb2c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x000075c457a9eb2c pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x000075c457a4527e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x000075c457a288ff abort ./stdlib/abort.c:81:7
 #9 0x000075c457a2881b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x000075c457a3b517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
#11 0x0000000004143bea (opt+0x4143bea)
#12 0x00000000049addf4 (anonymous namespace)::Scatterer::operator[](unsigned int) Scalarizer.cpp:0:0
#13 0x00000000049aa142 (anonymous namespace)::ScalarizerVisitor::visit(llvm::Function&) Scalarizer.cpp:0:0
#14 0x00000000049a5419 llvm::ScalarizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (opt+0x49a5419)

@inbelic
Copy link
Contributor

inbelic commented Feb 17, 2025

Thanks for the notification. Forwarding this to @Icohedron and @farzonl.

@jayfoad
Copy link
Contributor Author

jayfoad commented Feb 20, 2025

Closing this PR now that an issue has been opened.

@jayfoad jayfoad closed this Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants